GtkInvisible behaves like GtkWindow
authorMatthias Clasen <mclasen@redhat.com>
Fri, 3 May 2013 00:43:34 +0000 (20:43 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 3 May 2013 00:43:34 +0000 (20:43 -0400)
As far as refcounting is concerned, invisibles are like
windows: you have to destroy them.

gtk/tests/objects-finalize.c

index d113eb3d4ab420b6157222a58d77ee9f88d3615a..0e1eae000c19b94ea3c3838f0f0e49678ceb6bca 100644 (file)
@@ -63,7 +63,7 @@ test_finalize_object (gconstpointer data)
   g_object_weak_ref (object, check_finalized, &finalized);
 
   /* Toplevels are owned by GTK+, just tell GTK+ to destroy it */
-  if (GTK_IS_WINDOW (object))
+  if (GTK_IS_WINDOW (object) || GTK_IS_INVISIBLE (object))
     gtk_widget_destroy (GTK_WIDGET (object));
   else
     g_object_unref (object);